<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Input Type</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
       
        <link rel="stylesheet" href="css/styless.css" type="text/css" media="screen"/>
		<link rel="stylesheet" type="text/css" href="css/admin_templatemo_style.css"  />
	<link rel="stylesheet" type="text/css" href="css/menu.css"  />
	 <link rel="stylesheet" href="css/styless.css" type="text/css" media="screen"/>
	<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
	<script type="text/javascript" src="js/jquery-ui-1.8.22.custom.min.js"></script>
	<link rel="stylesheet" type="text/css" href=" css/jquery-ui-1.8.22.custom.css"/>
        <script type="text/javascript" src="js/sliding.form.js"></script>
		
			<SCRIPT type="text/javascript">
<!--
/*
Credits: Bit Repository
Source: http://www.bitrepository.com/web-programming/ajax/agent_code-checker.html 
*/

pic1 = new Image(16, 16); 
pic1.src = "images/loader.gif";

$(document).ready(function(){

$("#agent_code").change(function() { 

var usr = $("#agent_code").val();

if(usr.length >= 4)
{
$("#status").html('<img src="images/loader.gif" align="absmiddle">&nbsp;Checking availability...');

    $.ajax({  
    type: "POST",  
    url: "check_agent.php",  
    data: "agent_code="+ usr,  
    success: function(msg){  
   
   $("#status").ajaxComplete(function(event, request, settings){ 

	if(msg == 'OK')
	{ 
        $("#agent_code").removeClass('object_error'); // if necessary
		$("#agent_code").addClass("object_ok");
		$(this).html('&nbsp;<img src="images/tick.gif" align="absmiddle">');
	}  
	else  
	{  
		$("#agent_code").removeClass('object_ok'); // if necessary
		$("#agent_code").addClass("object_error");
		$(this).html(msg);
	}  
   
   });

 } 
   
  }); 

}
else
	{
	$("#status").html('<font color="red">The agent_code should have at least <strong>4</strong> characters.</font>');
	$("#agent_code").removeClass('object_ok'); // if necessary
	$("#agent_code").addClass("object_error");
	}

});

});

//-->
</SCRIPT>
		<script language="javaScript">
function setVisibility(id) {
if(document.getElementById('bt1').value=='Hide Layer'){
document.getElementById('bt1').value = 'Show Layer';
document.getElementById(id).style.display = 'none';
}else{
document.getElementById('bt1').value = 'Hide Layer';
document.getElementById(id).style.display = 'inline';
}
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
</script>
<script>

$("select.quickNav").change(function(){ if ($(this).val()!='') { window.location.href=$(this).val(); } });

</script>
    </head>
    <style>
        span.reference{
            position:fixed;
            left:5px;
            top:5px;
            font-size:10px;
            text-shadow:1px 1px 1px #fff;
        }
        span.reference a{
            color:#555;
            text-decoration:none;
			text-transform:uppercase;
        }
        span.reference a:hover{
            color:#000;
            
        }
        h1{
            color:#ccc;
            font-size:36px;
            text-shadow:1px 1px 1px #fff;
            padding:20px;
        }
    </style>
    <body>
        
        <div id="content">
            <h1>Brand</h1>
            <div id="wrapper">
                <div id="steps">
                    <form id="formElem" name="formElem" action="" method="post">
					
					<?php
					include 'db_connect.php';
					session_start();
					
							
						$username = $_SESSION['fname'];
						if (isset(
								$_POST['brand']
								
								
								))
							
						
							
							{
							$brand =  mysql_real_escape_string(htmlentities(trim($_POST['brand'])));
						
							
							
							mysql_query("INSERT INTO tblbrand
										(
										  `brand`
										 
										
										
										 )
										  
										
										VALUES 
										(
										
										
										\"$brand\"
									
										)") 
							
										or die(mysql_error());
										echo "<strong>Successful!<strong>";	
										header ('Location: inputbrand.php');
					
			}else{
			
			}
		
		?>
                        <fieldset class="step">
						<legend>Main</legend>
						
							<p>
                                <label for="brand">Brand</label>
                                <input id="brand" name="brand" type = "text" >
                            </p>
                            
							
							</fieldset>
							
						<fieldset class="step">
                            <legend>Confirm</legend>
							<p>
								Please fill up all the missing fields before you proceed
							</p>
                            <p class="submit">
                                <button id="registerButton" type="submit" name = "submit">Submit</button>
                            </p>
                        </fieldset>
                    </form>
                </div>
                <div id="navigation" style="display:none;">
                    <ul>
                        <li class="selected">
                            <a href="#">Main</a>
                        </li>
						
						<li>
                            <a href="#">Confirm</a>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </body>
</html>